c# .net

how to convert string to int in .net C# ?

how to convert string to int in .net C# ?, someone asked me to explain?

If you have a string such as "456", you cannot do math with it, or use it anywhere you could use an integer unless you first need to convert it to the int type.

  

String s = "456";
int i = Convert
.ToInt16(s);

Post your comments / questions